﻿// <copyright file="ICardControlService.cs" company="SharpSTS">
// Copyright (c) 2007, 2008 All Right Reserved, http://sharpsts.com/
//
// This source is subject to the Microsoft Permissive License.
// Please see the License.txt file for more information.
// All other rights reserved.
//
// THIS CODE AND INFORMATION ARE PROVIDED "AS IS" WITHOUT WARRANTY OF ANY 
// KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE
// IMPLIED WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A
// PARTICULAR PURPOSE.
//
// </copyright>
// <author>Barry Dorrans</author>
// <email>barryd@idunno.org</email>
// <date>2008-06-13</date>
// <summary>Defines a contract for the card control service.</summary>

namespace SharpSTS.CardControl
{
    using System.ServiceModel;

    using Constants;

    /// <summary>
    /// Defines a contract for the card control services
    /// </summary>
    [ServiceContract(Namespace = Namespaces.Service)]
    public interface ICardControlService
    {
        /// <summary>
        /// Gets an information card.
        /// </summary>
        /// <param name="request">The request parameters.</param>
        /// <returns>A <see cref="GetResponseMessage"/> containing the requested information card.</returns>
        [OperationContract(Name = "Get", Action = "Get", ReplyAction = "GetResponse")]
        [FaultContract(typeof(CardControlFault))]
        [FaultContract(typeof(ConfigurationFault))]
        [FaultContract(typeof(NotImplementedFault))]
        GetResponseMessage GetCard(GetRequestMessage request);

        /// <summary>
        /// Revokes the information card specified.
        /// </summary>
        /// <param name="request">The request parameters.</param>
        [OperationContract(Name = "RevokeCard", Action = "RevokeCard", ReplyAction = "RevokeCardResponse")]
        [FaultContract(typeof(CardControlFault))]
        [FaultContract(typeof(ConfigurationFault))]
        [FaultContract(typeof(NotImplementedFault))]
        void RevokeCard(RevokeCardRequestMessage request);

        /// <summary>
        /// Revokes all cards for the specified user.
        /// </summary>
        /// <param name="request">The request parameters.</param>
        [OperationContract(Name = "RevokeAllCardsForUser", Action = "RevokeAllCardsForUser", ReplyAction = "RevokeAllCardsForUserResponse")]
        [FaultContract(typeof(CardControlFault))]
        [FaultContract(typeof(ConfigurationFault))]
        [FaultContract(typeof(NotImplementedFault))]
        void RevokeAllCardsForUser(RevokeCardRequestMessage request);

        /// <summary>
        /// Reissues the specified information card.
        /// </summary>
        /// <param name="request">The request parameters.</param>
        /// <returns>A <see cref="GetResponseMessage"/> containing the requested information card.</returns>
        [OperationContract(Name = "Reissue", Action = "Reissue", ReplyAction = "GetResponse")]
        [FaultContract(typeof(CardControlFault))]
        [FaultContract(typeof(ConfigurationFault))]
        [FaultContract(typeof(NotImplementedFault))]
        GetResponseMessage Reissue(ReissueRequestMessage request);
    }
}
